import { FilterConst } from "../../../../component/gconst/FilterConst";
import { EffectManager } from "../../../manager/EffectManager";
import { CareerUtil } from "../../common/util/CareerUtil";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
type int = number;
//class SecondCareerItem
    
    export  class SecondCareerItem /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._selected = false;
            this.buttonMode = true;
            this.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.mouseOverHandler);
            this.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.mouseOutHandler);
            return;
        }

        /* internal  */mouseOverHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._selected) 
            {
                return;
            }
            this.filters = [FilterConst.worldMapFilter];
            return;
        }

        /* internal  */mouseOutHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._selected) 
            {
                return;
            }
            this.filters = [];
            return;
        }

        public get careerId(): int
        {
            return this._careerId;
        }

        public update(arg1: int): void
        {
            this._careerId = arg1;
            this.updateView();
            return;
        }

        public set selected(arg1: Boolean)
        {
            this._selected = arg1;
            if (this._selected) 
            {
                EffectManager.glowFilterReg(this, [FilterConst.worldMapFilter], 0.8, 10, 5, 0);
            }
            else 
            {
                EffectManager.glowFilterUnReg(this);
            }
            return;
        }

        public get selected(): Boolean
        {
            return this._selected;
        }

        /* internal  */updateView(): void
        {
            var loc1=CareerUtil.getScecondCareerImgURL(this._careerId);
            if (loc1 == "") 
            {
                return;
            }
            if (this._bg == null) 
            {
                this._bg = new Object /* flash.display.Bitmap */();
                this.addChild(this._bg);
            }
            LoaderHelp.setBitmapdata(loc1, this._bg);
            return;
        }

        /* internal */ /* var */_careerId: int;

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_selected: Boolean;
    }
